.TH std::thread::id 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::thread::id \- std::thread::id

.SH Synopsis
   Defined in header <thread>
   class thread::id;           \fI(since C++11)\fP

   The class thread::id is a lightweight, trivially copyable class that serves as a
   unique identifier of std::thread
   and std::jthread
   \fI(since C++20)\fP objects.

   Instances of this class may also hold the special distinct value that does not
   represent any thread. Once a thread has finished, the value of std::thread::id may
   be reused by another thread.

   This class is designed for use as key in associative containers, both ordered and
   unordered.

.SH Member functions

   constructor   constructs an id that does not represent a thread
                 \fI(public member function)\fP

.SH Non-member functions

   operator==
   operator!=
   operator<
   operator<=
   operator>
   operator>=         compares two thread::id objects
   operator<=>        \fI(function)\fP
   (removed in C++20)
   (removed in C++20)
   (removed in C++20)
   (removed in C++20)
   (removed in C++20)
   (C++20)
   operator<<         serializes a thread::id object
                      \fI(function template)\fP

.SH Helper classes

   std::hash<std::thread::id>      hash support for std::thread::id
   \fI(C++11)\fP                         \fI(class template specialization)\fP
   std::formatter<std::thread::id> formatting support for thread::id
   (C++23)                         \fI(class template specialization)\fP

.SH See also

   get_id  returns the id of the thread
           \fI(public member function)\fP
   get_id  returns the thread id of the current thread
   \fI(C++11)\fP \fI(function)\fP
